import request from "@/utils/request";

// 查询知识点列表
export function listJuanKnowledge(query) {
  return request({
    url: "/system/juanKnowledge/getKnowledgeList",
    method: "get",
    params: query,
  });
}

// 查询知识点详细
export function getJuanKnowledge(knowledgeId) {
  return request({
    url: "/system/juanKnowledge/" + knowledgeId,
    method: "get",
  });
}

// 新增知识点
export function addJuanKnowledge(data) {
  return request({
    url: "/system/juanKnowledge",
    method: "post",
    data: data,
  });
}

// 修改知识点
export function updateJuanKnowledge(data) {
  return request({
    url: "/system/juanKnowledge",
    method: "put",
    data: data,
  });
}

// 删除知识点
export function delJuanKnowledge(knowledgeId) {
  return request({
    url: "/system/juanKnowledge/" + knowledgeId,
    method: "delete",
  });
}

//查询章节树
export function chapterTree(courseId) {
  return request({
    url: "/system/juanChapter/getChapterTree/"+courseId,
    method: "get",
  });
}

//拖拽排序
export function juanKnowledgeDrag(data) {
  return request({
    url: "/system/juanKnowledge/drag",
    method: "put",
    data
  });
}


